Add support for logging to file via configuration#148
Merged
crmne merged 2 commits intocrmne:mainfrom May 6, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #148 +/- ##
=======================================
Coverage 93.65% 93.65%
=======================================
Files 87 87
Lines 3199 3200 +1
Branches 422 422
=======================================
+ Hits 2996 2997 +1
Misses 203 203 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
crmne
added a commit
that referenced
this pull request
May 6, 2025
## Purpose Introduces some basic configuration for the logging capabilities, allowing users to specify a custom log file and log level. This feature enhances debugging and monitoring capabilities by providing more control over where and how logs are recorded. ## Implementation Details - Added log_file configuration option (default: STDOUT) - Added log_level configuration option (default: INFO, or DEBUG if RUBYLLM_DEBUG env var is set) - Updated logger initialisation to use the configured log file and level - Added documentation for logging configuration - Maintained backward compatibility with existing logging behaviour ## Usage Example ```ruby # Global configuration RubyLLM.configure do |config| config.log_file = '/logs/ruby_llm.log' # Custom log file location config.log_level = :debug # Set log level end ``` ## Testing Manual - Verified logger initialisation with custom log file - Confirmed log level changes based on configuration - Tested environment variable override for debug level - Validated default behaviour (STDOUT logging) ## Documentation Added a new section in configuration.md for logging settings Co-authored-by: Carmine Paolino <carmine@paolino.me>
sbounmy
added a commit
to sbounmy/ruby_llm
that referenced
this pull request
May 12, 2025
…ith-image * 'main' of github.com:crmne/ruby_llm: (24 commits) Enhance Rails guide with detailed persistence flow explanation and setup instructions Remove work-in-progress warning from models documentation generation Add validation considerations for Message model and update persistence flow documentation Add note about upcoming OpenAI headers support in v1.3.0 Handle OpenAI organization and project IDs (crmne#162) Refactor acts_as_message and acts_as_tool_call methods to improve parameter handling and default values Remove reasoning section from available models documentation and rake task Remove debug logging for pricing in OpenRouter models Updated models page Fixed pricing parsing for OpenRouter Updated models Add warning about work in progress for Parsera integration in available models documentation Major refactoring of ModelInfo and Parsera API support for listing LLM capabilities and pricing. Fix inflector (crmne#159) Use foreign_key instead of to_s for acts_as methods (crmne#157) Fixes #embed fails when using default embedding model Add support for logging to file via configuration (crmne#148) Updated acts_as_* helpers to use canonical 'rails-style' foreign keys (crmne#151) refactor(media): streamline content formatting methods across providers Fixed Calling `chat.to_llm` keeps appending messages to the message array ...
parruda
pushed a commit
to parruda/ruby_llm
that referenced
this pull request
Nov 18, 2025
## Purpose Introduces some basic configuration for the logging capabilities, allowing users to specify a custom log file and log level. This feature enhances debugging and monitoring capabilities by providing more control over where and how logs are recorded. ## Implementation Details - Added log_file configuration option (default: STDOUT) - Added log_level configuration option (default: INFO, or DEBUG if RUBYLLM_DEBUG env var is set) - Updated logger initialisation to use the configured log file and level - Added documentation for logging configuration - Maintained backward compatibility with existing logging behaviour ## Usage Example ```ruby # Global configuration RubyLLM.configure do |config| config.log_file = '/logs/ruby_llm.log' # Custom log file location config.log_level = :debug # Set log level end ``` ## Testing Manual - Verified logger initialisation with custom log file - Confirmed log level changes based on configuration - Tested environment variable override for debug level - Validated default behaviour (STDOUT logging) ## Documentation Added a new section in configuration.md for logging settings Co-authored-by: Carmine Paolino <carmine@paolino.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Introduces some basic configuration for the logging capabilities, allowing users to specify a custom log file and log level. This feature enhances debugging and monitoring capabilities by providing more control over where and how logs are recorded.
Implementation Details
Usage Example
Testing
Manual
Documentation
Added a new section in configuration.md for logging settings